Multiple rich text in single line

HI,

I have written following code which makes complete sentence as BOLD but I want only specific string to be become bold. please let me know what I am doing wrong.

What I an trying to do:

1. I want to keep previous comment which is in rich text as it it. So spyied it in variable.

2. then include new user ID and date in BOLD and other comment in NON-bold format, and followed by previous

 

 

So in the end it should have recent coment with name and date in bold and details in non-bold.

Thanks in advance.

string name = "Mitesh"
string newreviewComment = ""
string reviewCommentIn = ""
string oldreviewComment = ""


Object o = (current Object)
oldreviewComment = richText(o."Rich text")
reviewCommentIn = name" " "<"""stringOf(today(),"dd-MMM-yyyy") ">"
o."Rich text" = richText" \\b "reviewCommentIn""     //Dummy write to get rich text not able to do it on variable level.
reviewCommentIn = richText(o."Rich text")
newreviewComment = ""reviewCommentIn""" :""\n" "This text should not become bold " "\n" oldreviewComment ""
o."Rich text" = richText(newreviewComment)

infoBox ("Done ")


MiteshJobanputra - Fri Sep 22 06:42:31 EDT 2017

Re: Multiple rich text in single line
O.Wilkop - Fri Sep 22 06:55:10 EDT 2017

You can use {} in rich text to apply formatting only to this certain block. So if you change:

 

o."Rich text" = richText" \\b "reviewCommentIn"" 

 

to

 

o."Rich text" = richText" {\\b "reviewCommentIn"}" 

 

you'll get your wanted result

Re: Multiple rich text in single line
MiteshJobanputra - Fri Sep 22 06:56:01 EDT 2017

O.Wilkop - Fri Sep 22 06:55:10 EDT 2017

You can use {} in rich text to apply formatting only to this certain block. So if you change:

 

o."Rich text" = richText" \\b "reviewCommentIn"" 

 

to

 

o."Rich text" = richText" {\\b "reviewCommentIn"}" 

 

you'll get your wanted result

Thanks a lot. I will try and let you know. Cheers

Re: Multiple rich text in single line
MiteshJobanputra - Fri Sep 22 06:57:59 EDT 2017

O.Wilkop - Fri Sep 22 06:55:10 EDT 2017

You can use {} in rich text to apply formatting only to this certain block. So if you change:

 

o."Rich text" = richText" \\b "reviewCommentIn"" 

 

to

 

o."Rich text" = richText" {\\b "reviewCommentIn"}" 

 

you'll get your wanted result

Worked like a charm :)

Thanks a lot.